<?php
/**
*	input
*/
namespace Rainrock\Framework\kernel\Html;



class HtmlInput extends HtmlLabel{
	
	public static function gets()
	{
		$obj = new HtmlInput();
		return $obj;
	}

	
	protected $close = false,$label = 'input',$type='text',$css='input',$value = '',$placeholder='',$data = array();
	
	
	protected function showBefore()
	{
		if($this->value || is_numeric($this->value))$this->addAttrs("value", $this->value);
		if($this->placeholder)$this->addAttrs("placeholder", $this->placeholder);
	}
	
	public function setValue($val)
	{
		$this->value = $val;
		return $this;
	}
	
	public function setLen($val)
	{
		$this->addAttrs("maxlength", $val);
		return $this;
	}

	public function setTishi($val)
	{
		$this->placeholder = $val;
		return $this;
	}
	
	
	/**
	*	设置数据源
	*/
	public function setData($data)
	{
		$this->data = $data;
		return $this;
	}	
}